//模块的构造方法
function User(rs) {
	this.id=rs.id;
	this.username=rs.username;
	this.realname=rs.realname;
	this.password=rs.password;
	this.role=rs.role;
	this.online=rs.online;
}
//定义表名
User.entityName = 'users';
//主键
User.entityIndex = 'id';
//redis过期时间
User.entityExpiration = 60*5;
User.entityCreated = 'created';
//属性
User.propNamesAsArray = [ 'id', 'username', 'realname', 'password','role','online' ];
//获得class用于redis删除对象
User.prototype.getClass = function() {
    return User;
};
//获得表名
User.prototype.getEntityName = function() {
    return User.entityName;
};
//获得主键
User.prototype.getEntityIndex = function() {
    return User.entityIndex;
};
//获得过期时间
User.prototype.getEntityExpiration = function() {
    return User.entityExpiration;
};

User.prototype.getEntityCreated = function() {
    return User.entityCreated;
};
//获得属性名称列表
User.prototype.getPropNamesAsArray = function() {
    return User.propNamesAsArray;
};
//获得属性名称列表
User.prototype.asArray = function() {
    return [
        this.id,
        this.username,
        this.realname,
        this.password,
        this.role,
        this.online
    ];
};
module.exports.User = User;